package itsos.dao;

import org.springframework.orm.ibatis.support.*;
import itsos.model.*;
import java.util.*;
public class IssueDao extends SqlMapClientDaoSupport {
	
	public Issue getProcIssueByIssueID(long issueID)
	{
		return (Issue)getSqlMapClientTemplate().queryForObject("Issue.getProcIssueByIssueID", issueID);
	}
	
	public Issue getReptIssueByIssueID(long issueID)
	{
		return (Issue)getSqlMapClientTemplate().queryForObject("Issue.getReptIssueByIssueID", issueID);
	}
	
	public void insertIssue(Issue issue)
	{
		getSqlMapClientTemplate().insert("Issue.insertIssue", issue);
	}
	
	public void updateIssue(Issue issue)
	{
		getSqlMapClientTemplate().update("Issue.updateIssue", issue);
	}
	
	
	public List getIssueList(long repositoryID)
	{
		return getSqlMapClientTemplate().queryForList("Issue.getIssueListByRepositoryID", repositoryID);
	}
	
	public Issue getViewIssueWithIssueComment(long issueID)
	{
		return (Issue) getSqlMapClientTemplate().queryForObject("Issue.getViewIssue", issueID);
	}
	
	public List getRegIssue(long mainIssueID)
	{
		return (List)getSqlMapClientTemplate().queryForList("Issue.getRegIssue", mainIssueID);
	}
	
	public void updateAdmin(Issue issue)
	{
		getSqlMapClientTemplate().update("Issue.updateAdmin", issue);
	}
	
	public void editProcessorContent(Issue issue)
	{
		getSqlMapClientTemplate().update("Issue.editProcessorContent", issue);
	}
	
	public void issueProc(Issue issue)
	{
		getSqlMapClientTemplate().update("Issue.processorUpdateIssue", issue);
	}
	
	public List adminProc(long repositoryID)
	{
		return getSqlMapClientTemplate().queryForList("Issue.adminProc", repositoryID);
	}
	
}
